package com.ulwx.database.sql;

/**
 * 用于帮助解决commons-BeanUtils-1.8.3包里的PropertyUtils类取属性和取类型时候区分属性名时候的问题
 * @author Administrator
 *
 */
public class Util {
	public static String changeFirstCharacterCase(String str,
			boolean capitalize) {
		if (str == null || str.length() == 0) {
			return str;
		}
		StringBuilder buf = new StringBuilder(str.length());
		if (capitalize) {
			buf.append(Character.toUpperCase(str.charAt(0)));
		} else {
			if(str.length()>=2){
				if(Character.isUpperCase(str.charAt(1))){
					return str;
				}
			}
			buf.append(Character.toLowerCase(str.charAt(0)));
		}
		buf.append(str.substring(1));
		return buf.toString();
	}
}
